/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.apt.hobbiestag.process.hobbies_likingprocess;

import com.apt.tag.Connect_DB;
import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 *
 * @author Bach
 */
public class DisableLiking {

    public static boolean setDisableLiking(String liking_Model_Id) {
        String up = "UPDATE [Matrimony].[dbo].[Liking_Models]\n"
                + "   SET  [Liking_Model_Status] = 0\n"
                + " WHERE [Liking_Model_Id]=? ";
        boolean re = false;
        PreparedStatement ps = null;
        Connection con = null;
        try {
            con = Connect_DB.getConnection();
            ps = con.prepareStatement(up);
            ps.setInt(1, Integer.parseInt(liking_Model_Id));
            int i = ps.executeUpdate();
            if (i > 0) {
                re = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            Connect_DB.close(null, ps, ps, con);
        }
        return re;
    }
}
